<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script type="text/javascript" src="./ajax3.js"></script>
    <script type="text/javascript">
        // ajax({
        //     type:'get',
        //     // url:'http://tom.com/jsonp.php',
        //     url:'http://localhost/cross/data.php',
        //     dataType:'json',
        //     success:function(data){
        //         console.log(data.username,data.password);
        //     }
        // });

        ajax({
            type:'get',
            url:'http://tom.com/jsonp.php',
            // url:'http://localhost/cross/data.php',
            dataType:'jsonp',
            data:{username:'zhangsan',password:'123'},
            jsonp:'cb',
            jsonpCallback:'abc',
            success:function(data){
                console.log(data.username,data.password);
            }
        });
    </script>
</head>
<body>
    
</body>
</html>